package com.jackrain.nea;

import com.jackrain.nea.core.db.DynamicDataSourceRegister;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Import;

/**
 * Created by jackrain on 16/8/6.
 * Notice:@Import 服务端引入DubboConfig.class，消费端引入DubboConfConsumer.class
 */

@SpringBootApplication
@Import({ModelConfig.class, DynamicDataSourceRegister.class})
public class Main extends SpringBootServletInitializer {


    public static void main(String[] args) {
        System.setProperty("spring.devtools.restart.enabled", "false");
        ApplicationContext context = SpringApplication.run(applicationClass, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(applicationClass);
    }

    private static Class<Main> applicationClass = Main.class;
}
